//
//  BHSportSignRecordModel.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/8/26.
//

import UIKit

class BHSportSignRecordModel {
    var day: String = ""
    
    var timeSignArray: [BHSportSignTimeModel] = []
    
    func parseDic(_ dic: [String:Any]) {
        self.day = BHJsonTool.decodeStringFromDic(dic: dic, key: "day")
        
        let array = BHJsonTool.decodeArrayFromDic(dic: dic, key: "campaignPlanList")
        for item in array {
            let model = BHSportSignTimeModel.init()
            model.parseDic(item as! [String: Any])
            
            self.timeSignArray.append(model)
        }
        
    }
}

class BHSportSignTimeModel {
    var planId: String = ""
    var clockTime: String = ""
    var dayClockFlag: Int = 0 // 打卡状态 0:缺卡 1:已打卡
    
    
    func parseDic(_ dic: [String:Any]) {
        self.planId = BHJsonTool.decodeStringFromDic(dic: dic, key: "id")
        self.clockTime = BHJsonTool.decodeStringFromDic(dic: dic, key: "clockTime")
        
        self.dayClockFlag = BHJsonTool.decodeIntFromDic(dic: dic, key: "dayClockFlag")

    }
}
